#include <iostream>
using namespace std;
using LL = long long;
LL t;
int main()
{
    // 请在此输入您的代码
    cin >> t;
    t %= 24 * 60 *60 * 1000;
    t /= 1000;
    int ss = t%60;
    t /= 60;
    int mm = t%60;
    int hh = t/60;
    string s;
    if(hh < 10) s += '0';
    s = s + to_string(hh) + ':';
    if(mm < 10) s += '0';
    s = s + to_string(mm) + ':';
    if(ss < 10) s += '0';
    s += to_string(ss);
    cout << s;
    return 0;
}